/*************************************************************************
 * @file: ipoint.cpp
 * @date: 01/04/2012
 * TOPOL v1_0 - (c)copyright 2012 TEC/UFF
 *************************************************************************
 * This is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 ************************************************************************/

// includes
//----------
#include "ipoint.h"
#include <iostream>


///////////////////////////////////////////////////
///  Constructor and Destructor Implementation  ///
///////////////////////////////////////////////////

//-------------------------------------------------------------------------
IPoint::IPoint()
{

}
//-------------------------------------------------------------------------

//-------------------------------------------------------------------------
IPoint::IPoint( double _x, double _y, double _z )	
:	m_x( _x )			
,	m_y( _y )
,	m_z( _z )
{

}
//-------------------------------------------------------------------------



///////////////////////////////////////
///  PUBLIC Methods Implementation  ///
///////////////////////////////////////

//-------------------------------------------------------------------------
double 
IPoint::distance2( double _x, double _y, double _z )
{
   return ((m_x-_x)*(m_x-_x)+(m_y-_y)*(m_y-_y)+(m_z-_z)*(m_z-_z));
}
//-------------------------------------------------------------------------

//-------------------------------------------------------------------------
double 
IPoint::distance2( IPoint _p )
{
  return ((m_x-_p.m_x)*(m_x-_p.m_x)+(m_y-_p.m_y)*(m_y-_p.m_y)+(m_z-_p.m_z)*(m_z-_p.m_z));
}
//-------------------------------------------------------------------------

//-------------------------------------------------------------------------
double 
IPoint::getX()
{
  return m_x;
}
//-------------------------------------------------------------------------

//-------------------------------------------------------------------------
double 
IPoint::getY()
{
  return m_y;
}
//-------------------------------------------------------------------------

//-------------------------------------------------------------------------
double 
IPoint::getZ()
{
  return m_z;
}
//-------------------------------------------------------------------------
